home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_emacs.idb / usr / freeware / info / emacs-22.z / emacs-22
Encoding:
GNU Info File  |  1998-10-28  |  48.8 KB  |  1,301 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.63 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Resume Arguments,  Next: Environment,  Prev: Command Example,  Up: Command Arguments
  6.  
  7. Resuming Emacs with Arguments
  8. =============================
  9.  
  10.    You can specify action arguments for Emacs when you resume it after
  11. a suspension.  To prepare for this, put the following code in your
  12. `.emacs' file (*note Hooks::.):
  13.  
  14.      (add-hook 'suspend-hook 'resume-suspend-hook)
  15.      (add-hook 'suspend-resume-hook 'resume-process-args)
  16.  
  17.    As further preparation, you must execute the shell script
  18. `emacs.csh' (if you use csh as your shell) or `emacs.bash' (if you use
  19. bash as your shell).  These scripts define an alias named `edit', which
  20. will resume Emacs giving it new command line arguments such as files to
  21. visit.
  22.  
  23.    Only action arguments work properly when you resume Emacs.  Initial
  24. arguments are not recognized--it's too late to execute them anyway.
  25.  
  26.    Note that resuming Emacs (with or without arguments) must be done
  27. from within the shell that is the parent of the Emacs job.  This is why
  28. `edit' is an alias rather than a program or a shell script.  It is not
  29. possible to implement a resumption command that could be run from other
  30. subjobs of the shell; no way to define a command that could be made the
  31. value of `EDITOR', for example.  Therefore, this feature does not take
  32. the place of the Emacs Server feature (*note Emacs Server::.).
  33.  
  34.    The aliases use the Emacs Server feature if you appear to have a
  35. server Emacs running.  However, they cannot determine this with complete
  36. accuracy.  They may think that a server is still running when in
  37. actuality you have killed that Emacs, because the file `/tmp/.esrv...'
  38. still exists.  If this happens, find that file and delete it.
  39.  
  40. 
  41. File: emacs,  Node: Environment,  Next: Display X,  Prev: Resume Arguments,  Up: Command Arguments
  42.  
  43. Environment Variables
  44. =====================
  45.  
  46.    This appendix describes how Emacs uses environment variables.  An
  47. environment variable is a string passed from the operating system to
  48. Emacs, and the collection of environment variables is known as the
  49. environment.  Environment variable names are case sensitive and it is
  50. conventional to use upper case letters only.
  51.  
  52.    Because environment variables come from the operating system there
  53. is no general way to set them; it depends on the operating system and
  54. especially the shell that you are using.  For example, here's how to set
  55. the environment variable `ORGANIZATION' to `not very much' using bash:
  56.  
  57.      export ORGANIZATION="not very much"
  58.  
  59. and here's how to do it in csh or tcsh:
  60.  
  61.      setenv ORGANIZATION "not very much"
  62.  
  63.    When Emacs is set-up to use the X windowing system, it inherits the
  64. use of a large number of environment variables from the X library.  See
  65. the X documentation for more information.
  66.  
  67. * Menu:
  68.  
  69. * General Variables::     Environment variables that all versions of Emacs use.
  70. * Misc Variables::        Certain system specific variables.
  71.  
  72. 
  73. File: emacs,  Node: General Variables,  Next: Misc Variables,  Up: Environment
  74.  
  75. General Variables
  76. -----------------
  77.  
  78. `AUTHORCOPY'
  79.      The name of a file used to archive news articles posted with the
  80.      GNUS package.
  81.  
  82. `CDPATH'
  83.      Used by the `cd' command.
  84.  
  85. `DOMAINNAME'
  86.      The name of the internet domain that the machine running Emacs is
  87.      located in.  Used by the GNUS package.
  88.  
  89. `EMACSDATA'
  90.      Used to initialize the variable `data-directory' used to locate the
  91.      architecture-independent files that come with Emacs.  Setting this
  92.      variable overrides the setting in `paths.h' when Emacs was built.
  93.  
  94. `EMACSLOADPATH'
  95.      A colon-separated list of directories from which to load Emacs Lisp
  96.      files.  Setting this variable overrides the setting in `paths.h'
  97.      when Emacs was built.
  98.  
  99. `EMACSLOCKDIR'
  100.      The directory that Emacs places lock files--files used to protect
  101.      users from editing the same files simultaneously.  Setting this
  102.      variable overrides the setting in `paths.h' when Emacs was built.
  103.  
  104. `EMACSPATH'
  105.      The location of Emacs-specific binaries.  Setting this variable
  106.      overrides the setting in `paths.h' when Emacs was built.
  107.  
  108. `ESHELL'
  109.      Used for shell-mode to override the `SHELL' environment variable.
  110.  
  111. `HISTFILE'
  112.      The name of the file that shell commands are saved in between
  113.      logins.  This variable defaults to `~/.history' if you use (t)csh
  114.      as shell, to `~/.bash_history' if you use bash, to `~/.sh_history'
  115.      if you use ksh, and to `~/.history' otherwise.
  116.  
  117. `HOME'
  118.      The location of the user's files in the directory tree; used for
  119.      expansion of file names starting with a tilde (`~').  On MS-DOS, it
  120.      defaults to the directory from which Emacs was started, with `/bin'
  121.      removed from the end if it was present.
  122.  
  123. `HOSTNAME'
  124.      The name of the machine that Emacs is running on.
  125.  
  126. `INCPATH'
  127.      A colon-separated list of directories.  Used by the `complete'
  128.      package to search for files.
  129.  
  130. `INFOPATH'
  131.      A colon separated list of directories holding info files.  Setting
  132.      this variable overrides the setting in `paths.el' when Emacs was
  133.      built.
  134.  
  135. `LOGNAME'
  136.      The user's login name.  See also `USER'.
  137.  
  138. `MAIL'
  139.      The name of the user's system mail box.
  140.  
  141. `MAILRC'
  142.      Name of file containing mail aliases.  This defaults to
  143.      `~/.mailrc'.
  144.  
  145. `MH'
  146.      Name of setup file for the mh system.  This defaults to
  147.      `~/.mh_profile'.
  148.  
  149. `NAME'
  150.      The real-world name of the user.
  151.  
  152. `NNTPSERVER'
  153.      The name of the news server.  Used by the mh and GNUS packages.
  154.  
  155. `ORGANIZATION'
  156.      The name of the organization to which you belong.  Used for
  157.      setting the `Organization:' header in your posts from the GNUS
  158.      package.
  159.  
  160. `PATH'
  161.      A colon-separated list of directories in which executables reside.
  162.      (On MS-DOS, it is semicolon-separated instead.)  This variable is
  163.      used to set the Emacs Lisp variable `exec-path' which you should
  164.      consider to use instead.
  165.  
  166. `PWD'
  167.      If set, this should be the default directory when Emacs was
  168.      started.
  169.  
  170. `REPLYTO'
  171.      If set, this specifies an initial value for the variable
  172.      `mail-default-reply-to'.  *Note Mail Headers::.
  173.  
  174. `SAVEDIR'
  175.      The name of a directory in which news articles are saved by
  176.      default.  Used by the GNUS package.
  177.  
  178. `SHELL'
  179.      The name of an interpreter used to parse and execute programs run
  180.      from inside Emacs.
  181.  
  182. `TERM'
  183.      The name of the terminal that Emacs is running on.  The variable
  184.      must be set unless Emacs is run in batch mode.  On MS-DOS, it
  185.      defaults to `internal', which specifies a built-in terminal
  186.      emulation that handles the machine's own display.
  187.  
  188. `TERMCAP'
  189.      The name of the termcap library file describing how to program the
  190.      terminal specified by the `TERM' variable.  This defaults to
  191.      `/etc/termcap'.
  192.  
  193. `TMPDIR'
  194.      Used by the Emerge package as a prefix for temporary files.
  195.  
  196. `TZ'
  197.      This specifies the current time zone and possibly also daylight
  198.      savings information.  On MS-DOS, the default is based on country
  199.      code; see the file `msdos.c' for details.
  200.  
  201. `USER'
  202.      The user's login name.  See also `LOGNAME'.  On MS-DOS, this
  203.      defaults to `root'.
  204.  
  205. `VERSION_CONTROL'
  206.      Used to initialize the `version-control' variable (*note Backup
  207.      Names::.).
  208.  
  209. 
  210. File: emacs,  Node: Misc Variables,  Prev: General Variables,  Up: Environment
  211.  
  212. Misc Variables
  213. --------------
  214.  
  215.    These variables are used only on particular configurations:
  216.  
  217. `COMSPEC'
  218.      On MS-DOS, the name of the command interpreter to use.  This is
  219.      used to make a default value for the `SHELL' environment variable.
  220.  
  221. `NAME'
  222.      On MS-DOS, this variable defaults to the value of the `USER'
  223.      variable.
  224.  
  225. `TEMP'
  226. `TMP'
  227.      On MS-DOS, these specify the name of the directory for storing
  228.      temporary files in.
  229.  
  230. `EMACSTEST'
  231.      On MS-DOS, this specifies a file to use to log the operation of the
  232.      internal terminal emulator.  This feature is useful for submitting
  233.      bug reports.
  234.  
  235. `EMACSCOLORS'
  236.      Used on MS-DOS systems to set screen colors early, so that the
  237.      screen won't momentarily flash the default colors when Emacs
  238.      starts up.  The value of this variable should be two-character
  239.      encoding of the foreground (the first character) and the
  240.      background (the second character) colors of the default face.
  241.      Each character should be the hexadecimal code for the desired
  242.      color on a standard PC text-mode display.
  243.  
  244.      Only the low three bits of the background color are actually used,
  245.      because the PC display supports only eight background colors.
  246.  
  247. `WINDOW_GFX'
  248.      Used when initializing the Sun windows system.
  249.  
  250. 
  251. File: emacs,  Node: Display X,  Next: Font X,  Prev: Environment,  Up: Command Arguments
  252.  
  253. Specifying the Display Name
  254. ===========================
  255.  
  256.    The environment variable `DISPLAY' tells all X clients, including
  257. Emacs, where to display their windows.  Its value is set up by default
  258. in ordinary circumstances, when you start an X server and run jobs
  259. locally.  Occasionally you may need to specify the display yourself; for
  260. example, if you do a remote login and want to run a client program
  261. remotely, displaying on your local screen.
  262.  
  263.    With Emacs, the main reason people change the default display is to
  264. let them log into another system, run Emacs on that system, but have the
  265. window displayed at their local terminal.  You might need to use login
  266. to another system because the files you want to edit are there, or
  267. because the Emacs executable file you want to run is there.
  268.  
  269.    The syntax of the `DISPLAY' environment variable is
  270. `HOST:DISPLAY.SCREEN', where HOST is the host name of the X Window
  271. System server machine, DISPLAY is an arbitrarily-assigned number that
  272. distinguishes your server (X terminal) from other servers on the same
  273. machine, and SCREEN is a rarely-used field that allows an X server to
  274. control multiple terminal screens.  The period and the SCREEN field are
  275. optional.  If included, SCREEN is usually zero.
  276.  
  277.    For example, if your host is named `glasperle' and your server is
  278. the first (or perhaps the only) server listed in the configuration, your
  279. `DISPLAY' is `glasperle:0.0'.
  280.  
  281.    You can specify the display name explicitly when you run Emacs,
  282. either by changing the `DISPLAY' variable, or with the option `-d
  283. DISPLAY' or `--display=DISPLAY'.  Here is an example:
  284.  
  285.      emacs --display=glasperle:0 &
  286.  
  287.    You can inhibit the direct use of X with the `-nw' option.  This is
  288. also an initial option.  It tells Emacs to display using ordinary ASCII
  289. on its controlling terminal.
  290.  
  291.    Sometimes, security arrangements prevent a program on a remote system
  292. from displaying on your local system.  In this case, trying to run Emacs
  293. produces messages like this:
  294.  
  295.      Xlib:  connection to "glasperle:0.0" refused by server
  296.  
  297. You might be able to overcome this problem by using the `xhost' command
  298. on the local system to give permission for access from your remote
  299. machine.
  300.  
  301. 
  302. File: emacs,  Node: Font X,  Next: Colors X,  Prev: Display X,  Up: Command Arguments
  303.  
  304. Font Specification Options
  305. ==========================
  306.  
  307.    By default, Emacs displays text in the font named `9x15', which
  308. makes each character nine pixels wide and fifteen pixels high.  You can
  309. specify a different font on your command line through the option `-fn
  310. NAME'.
  311.  
  312. `-fn NAME'
  313.      Use font NAME as the default font.
  314.  
  315. `--font=NAME'
  316.      `--font' is an alias for `-fn'.
  317.  
  318.    Under X, each font has a long name which consists of eleven words or
  319. numbers, separated by dashes.  Some fonts also have shorter
  320. nicknames--`9x15' is such a nickname.  You can use either kind of name.
  321. You can use wild card patterns for the font name; then Emacs lets X
  322. choose one of the fonts that match the pattern.  Here is an example,
  323. which happens to specify the font whose nickname is `6x13':
  324.  
  325.      emacs -fn "-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1" &
  326.  
  327. You can also specify the font in your `.Xdefaults' file:
  328.  
  329.      emacs.font: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1
  330.  
  331.    A long font name has the following form:
  332.  
  333.      -MAKER-FAMILY-WEIGHT-SLANT-WIDTHTYPE-STYLE...
  334.      ...-PIXELS-HEIGHT-HORIZ-VERT-SPACING-WIDTH-CHARSET
  335.  
  336. FAMILY
  337.      This is the name of the font family-for example, `courier'.
  338.  
  339. WEIGHT
  340.      This is normally `bold', `medium' or `light'.  Other words may
  341.      appear here in some font names.
  342.  
  343. SLANT
  344.      This is `r' (roman), `i' (italic), `o' (oblique), `ri' (reverse
  345.      italic), or `ot' (other).
  346.  
  347. WIDTHTYPE
  348.      This is normally `condensed', `extended', `semicondensed' or
  349.      `normal'.  Other words may appear here in some font names.
  350.  
  351. STYLE
  352.      This is an optional additional style name.  Usually it is
  353.      empty--most long font names have two hyphens in a row at this
  354.      point.
  355.  
  356. PIXELS
  357.      This is the font height, in pixels.
  358.  
  359. HEIGHT
  360.      This is the font height on the screen, measured in printer's points
  361.      (approximately 1/72 of an inch), times ten.  For a given vertical
  362.      resolution, HEIGHT and PIXELS are proportional; therefore, it is
  363.      common to specify just one of them and use `*' for the other.
  364.  
  365. HORIZ
  366.      This is the horizontal resolution, in pixels per inch, of the
  367.      screen for which the font is intended.
  368.  
  369. VERT
  370.      This is the vertical resolution, in dots per inch, of the screen
  371.      for which the font is intended.  Normally the resolution of the
  372.      fonts on your system is the right value for your screen;
  373.      therefore, you normally specify `*' for this and HORIZ.
  374.  
  375. SPACING
  376.      This is `m' (monospace), `p' (proportional) or `c' (character
  377.      cell).  Emacs can use `m' and `c' fonts.
  378.  
  379. WIDTH
  380.      This is the average character width, in pixels, times ten.
  381.  
  382. CHARSET
  383.      This is the character set that the font depicts.  Normally you
  384.      should use `iso8859-1'.
  385.  
  386.    Use only fixed width fonts--that is, fonts in which all characters
  387. have the same width; Emacs cannot yet handle display properly for
  388. variable width fonts.  Any font with `m' or `c' in the SPACING field of
  389. the long name is a fixed width font.  Here's how to use the `xlsfonts'
  390. program to list all the fixed width fonts available on your system:
  391.  
  392.      xlsfonts -fn '*x*'
  393.      xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-m*'
  394.      xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-c*'
  395.  
  396. To see what a particular font looks like, use the `xfd' command.  For
  397. example:
  398.  
  399.      xfd -fn 6x13
  400.  
  401. displays the entire font `6x13'.
  402.  
  403.    While running Emacs, you can set the font of the current frame
  404. (*note Frame Parameters::.) or for a specific kind of text (*note
  405. Faces::.).
  406.  
  407. 
  408. File: emacs,  Node: Colors X,  Next: Window Size X,  Prev: Font X,  Up: Command Arguments
  409.  
  410. Window Color Options
  411. ====================
  412.  
  413.    On a color display, you can specify which color to use for various
  414. parts of the Emacs display.  To find out what colors are available on
  415. your system, look at the `/usr/lib/X11/rgb.txt' file.  If you do not
  416. specify colors, the default for the background is white and the default
  417. for all other colors is black.  On a monochrome display, the foreground
  418. is black, the background is white, and the border is gray if the
  419. display supports that.
  420.  
  421.    Here is a list of the options for specifying colors:
  422.  
  423. `-fg COLOR'
  424. `--foreground-color=COLOR'
  425.      Specify the foreground color.
  426.  
  427. `-bg COLOR'
  428. `--background-color=COLOR'
  429.      Specify the background color.
  430.  
  431. `-bd COLOR'
  432. `--border-color=COLOR'
  433.      Specify the color of the border of the X window.
  434.  
  435. `-cr COLOR'
  436. `--cursor-color=COLOR'
  437.      Specify the color of the Emacs cursor which indicates where point
  438.      is.
  439.  
  440. `-ms COLOR'
  441. `--mouse-color=COLOR'
  442.      Specify the color for the mouse cursor when the mouse is in the
  443.      Emacs window.
  444.  
  445. `-r'
  446. `--reverse-video'
  447.      Reverse video--swap the foreground and background colors.
  448.  
  449.    For example, to use a coral mouse cursor and a slate blue text
  450. cursor, enter:
  451.  
  452.      emacs -ms coral -cr 'slate blue' &
  453.  
  454.    You can reverse the foreground and background colors through the
  455. `-r' option or with the X resource `reverseVideo'.
  456.  
  457. 
  458. File: emacs,  Node: Window Size X,  Next: Borders X,  Prev: Colors X,  Up: Command Arguments
  459.  
  460. Options for Window Geometry
  461. ===========================
  462.  
  463.    The `-geometry' option controls the size and position of the initial
  464. Emacs frame.  Here is the format for specifying the window geometry:
  465.  
  466. `-g WIDTHxHEIGHT{+-}XOFFSET{+-}YOFFSET'
  467.      Specify window size WIDTH and HEIGHT (measured in character
  468.      columns and lines), and positions XOFFSET and YOFFSET (measured in
  469.      pixels).
  470.  
  471. `--geometry=WIDTHxHEIGHT{+-}XOFFSET{+-}YOFFSET'
  472.      This is another way of writing the same thing.
  473.  
  474. `{+-}' means either a plus sign or a minus sign.  A plus sign before
  475. XOFFSET means it is the distance from the left side of the screen; a
  476. minus sign means it counts from the right side.  A plus sign before
  477. YOFFSET means it is the distance from the top of the screen, and a
  478. minus sign there indicates the distance from the bottom.  The values
  479. XOFFSET and YOFFSET may themselves be positive or negative, but that
  480. doesn't change their meaning, only their direction.
  481.  
  482.    Emacs uses the same units as `xterm' does to interpret the geometry.
  483. The WIDTH and HEIGHT are measured in characters, so a large font
  484. creates a larger frame than a small font.  The XOFFSET and YOFFSET are
  485. measured in pixels.
  486.  
  487.    Since the mode line and the echo area occupy the last 2 lines of the
  488. frame, the height of the initial text window is 2 less than the height
  489. specified in your geometry.  In non-X-toolkit versions of Emacs, the
  490. menu bar also takes one line of the specified number.
  491.  
  492.    You do not have to specify all of the fields in the geometry
  493. specification.
  494.  
  495.    If you omit both XOFFSET and YOFFSET, the window manager decides
  496. where to put the Emacs frame, possibly by letting you place it with the
  497. mouse.  For example, `164x55' specifies a window 164 columns wide,
  498. enough for two ordinary width windows side by side, and 55 lines tall.
  499.  
  500.    The default width for Emacs is 80 characters and the default height
  501. is 40 lines.  You can omit either the width or the height or both.  If
  502. you start the geometry with an integer, Emacs interprets it as the
  503. width.  If you start with an `x' followed by an integer, Emacs
  504. interprets it as the height.  Thus, `81' specifies just the width;
  505. `x45' specifies just the height.
  506.  
  507.    If you start with `+' or `-', that introduces an offset, which means
  508. both sizes are omitted.  Thus, `-3' specifies the XOFFSET only.  (If
  509. you give just one offset, it is always XOFFSET.)  `+3-3' specifies both
  510. the XOFFSET and the YOFFSET, placing the frame near the bottom left of
  511. the screen.
  512.  
  513.    You can specify a default for any or all of the fields in
  514. `.Xdefaults' file, and then override selected fields with a
  515. `--geometry' option.
  516.  
  517. 
  518. File: emacs,  Node: Borders X,  Next: Title X,  Prev: Window Size X,  Up: Command Arguments
  519.  
  520. Internal and External Borders
  521. =============================
  522.  
  523.    An Emacs frame has an internal border and an external border.  The
  524. internal border is an extra strip of the background color around all
  525. four edges of the frame.  Emacs itself adds the internal border.  The
  526. external border is added by the window manager outside the internal
  527. border; it may contain various boxes you can click on to move or iconify
  528. the window.
  529.  
  530. `-ib WIDTH'
  531. `--internal-border=WIDTH'
  532.      Specify WIDTH as the width of the internal border.
  533.  
  534. `-bw WIDTH'
  535. `--border-width=WIDTH'
  536.      Specify WIDTH as the width of the main border.
  537.  
  538.    When you specify the size of the frame, that does not count the
  539. borders.  The frame's position is measured from the outside edge of the
  540. external border.
  541.  
  542.    Use the `-ib N' option to specify an internal border N pixels wide.
  543. The default is 1.  Use `-bw N' to specify the width of the external
  544. border (though the window manager may not pay attention to what you
  545. specify).  The default width of the external border is 2.
  546.  
  547. 
  548. File: emacs,  Node: Title X,  Next: Icons X,  Prev: Borders X,  Up: Command Arguments
  549.  
  550. Frame Titles
  551. ============
  552.  
  553.    An Emacs frame may or may not have a specified title.  The frame
  554. title, if specified, appears in window decorations and icons as the name
  555. of the frame.  If an Emacs frame has no specified title, the default
  556. title is the name of the executable program (if there is only one frame)
  557. or the selected window's buffer name (if there is more than one frame).
  558.  
  559.    You can specify a title for the initial Emacs frame with a command
  560. line option:
  561.  
  562. `-title TITLE'
  563. `--title=TITLE'
  564. `-T TITLE'
  565.      Specify TITLE as the title for the initial Emacs frame.
  566.  
  567.    The `--name' option (*note Resources X::.) also specifies the title
  568. for the initial Emacs frame.
  569.  
  570. 
  571. File: emacs,  Node: Icons X,  Next: Resources X,  Prev: Title X,  Up: Command Arguments
  572.  
  573. Icons
  574. =====
  575.  
  576.    Most window managers allow the user to "iconify" a frame, removing
  577. it from sight, and leaving a small, distinctive "icon" window in its
  578. place.  Clicking on the icon window makes the frame itself appear again.
  579. If you have many clients running at once, you can avoid cluttering up
  580. the screen by iconifying most of the clients.
  581.  
  582. `-i'
  583. `--icon-type'
  584.      Use a picture of a gnu as the Emacs icon.
  585.  
  586. `-iconic'
  587. `--iconic'
  588.      Start Emacs in iconified state.
  589.  
  590.    The `-i' or `--icon-type' option tells Emacs to use an icon window
  591. containing a picture of the GNU gnu.  If omitted, Emacs lets the window
  592. manager choose what sort of icon to use--usually just a small rectangle
  593. containing the frame's title.
  594.  
  595.    The `-iconic' option tells Emacs to begin running as an icon, rather
  596. than opening a frame right away.  In this situation, the icon window
  597. provides only indication that Emacs has started; the usual text frame
  598. doesn't appear until you deiconify it.
  599.  
  600. 
  601. File: emacs,  Node: Resources X,  Next: Lucid Resources,  Prev: Icons X,  Up: Command Arguments
  602.  
  603. X Resources
  604. ===========
  605.  
  606.    Programs running under the X Window System organize their user
  607. options under a hierarchy of classes and resources.  You can specify
  608. default values for these options in your X resources file, usually named
  609. `~/.Xdefaults'.
  610.  
  611.    Each line in the file specifies a value for one option or for a
  612. collection of related options, for one program or for several programs
  613. (optionally even for all programs).
  614.  
  615.    Programs define named resources with particular meanings.  They also
  616. define how to group resources into named classes.  For instance, in
  617. Emacs, the `internalBorder' resource controls the width of the internal
  618. border, and the `borderWidth' resource controls the width of the
  619. external border.  Both of these resources are part of the `BorderWidth'
  620. class.  Case distinctions are significant in these names.
  621.  
  622.    In `~/.Xdefaults', you can specify a value for a single resource on
  623. one line, like this:
  624.  
  625.      emacs.borderWidth: 2
  626.  
  627. Or you can use a class name to specify the same value for all resources
  628. in that class.  Here's an example:
  629.  
  630.      emacs.BorderWidth: 2
  631.  
  632.    If you specify a value for a class, it becomes the default for all
  633. resources in that class.  You can specify values for individual
  634. resources as well; these override the class value, for those particular
  635. resources.  Thus, this example specifies 2 as the default width for all
  636. borders, but overrides this value with 4 for the external border:
  637.  
  638.      emacs.Borderwidth: 2
  639.      emacs.borderwidth: 4
  640.  
  641.    The order in which the lines appear in the file does not matter.
  642. Also, command-line options always override the X resources file.
  643.  
  644.    The string `emacs' in the examples above is also a resource name.
  645. It actually represents the name of the executable file that you invoke
  646. to run Emacs.  If Emacs is installed under a different name, it looks
  647. for resources under that name instead of `emacs'.
  648.  
  649. `-name NAME'
  650. `--name=NAME'
  651.      Use NAME as the resource name (and the title) for the initial
  652.      Emacs frame.  This option does not affect subsequent frames, but
  653.      Lisp programs can specify frame names when they create frames.
  654.  
  655.      If you don't specify this option, the default is to use the Emacs
  656.      executable's name as the resource name.
  657.  
  658. `-xrm RESOURCE-VALUES'
  659. `--xrm=RESOURCE-VALUES'
  660.      Specify X resource values for this Emacs job (see below).
  661.  
  662.    For consistency, `-name' also specifies the name to use for other
  663. resource values that do not belong to any particular frame.
  664.  
  665.    The resources that name Emacs invocations also belong to a class; its
  666. name is `Emacs'.  If you write `Emacs' instead of `emacs', the resource
  667. applies to all frames in all Emacs jobs, regardless of frame titles and
  668. regardless of the name of the executable file.  Here is an example:
  669.  
  670.      Emacs.BorderWidth: 2
  671.      Emacs.borderWidth: 4
  672.  
  673.    You can specify a string of additional resource values for Emacs to
  674. use with the command line option `-xrm RESOURCES'.  The text RESOURCES
  675. should have the same format that you would use inside a file of X
  676. resources.  To include multiple resource specifications in DATA, put a
  677. newline between them, just as you would in a file.  You can also use
  678. `#include "FILENAME"' to include a file full of resource
  679. specifications.  Resource values specified with `-xrm' take precedence
  680. over all other resource specifications.
  681.  
  682.    The following table lists the resource names that designate options
  683. for Emacs, each with the class that it belongs to:
  684.  
  685. `background' (class `Background')
  686.      Background color name.
  687.  
  688. `bitmapIcon' (class `BitmapIcon')
  689.      Use a bitmap icon (a picture of a gnu) if `on', let the window
  690.      manager choose an icon if `off'.
  691.  
  692. `borderColor' (class `BorderColor')
  693.      Color name for the external border.
  694.  
  695. `borderWidth' (class `BorderWidth')
  696.      Width in pixels of the external border.
  697.  
  698. `cursorColor' (class `Foreground')
  699.      Color name for text cursor (point).
  700.  
  701. `font' (class `Font')
  702.      Font name for text.
  703.  
  704. `foreground' (class `Foreground')
  705.      Color name for text.
  706.  
  707. `geometry' (class `Geometry')
  708.      Window size and position.  Be careful not to specify this resource
  709.      as `emacs*geometry', because that may affect individual menus as
  710.      well as the Emacs frame itself.
  711.  
  712.      If this resource specifies a position, that position applies only
  713.      to the initial Emacs frame (or, in the case of a resource for a
  714.      specific frame name, only that frame).  However, the size if
  715.      specified here applies to all frames.
  716.  
  717. `iconName' (class `Title')
  718.      Name to display in the icon.
  719.  
  720. `internalBorder' (class `BorderWidth')
  721.      Width in pixels of the internal border.
  722.  
  723. `menuBar' (class `MenuBar')
  724.      Give frames menu bars if `on'; don't have menu bars if `off'.
  725.  
  726. `paneFont' (class `Font')
  727.      Font name for menu pane titles, in non-toolkit versions of Emacs.
  728.  
  729. `pointerColor' (class `Foreground')
  730.      Color of the mouse cursor.
  731.  
  732. `reverseVideo' (class `ReverseVideo')
  733.      Switch foreground and background default colors if `on', use
  734.      colors as specified if `off'.
  735.  
  736. `verticalScrollBars' (class `ScrollBars')
  737.      Give frames scroll bars if `on'; don't have scroll bars if `off'.
  738.  
  739. `selectionFont' (class `Font')
  740.      Font name for pop-up menu items, in non-toolkit versions of Emacs.
  741.      (For toolkit versions, see *Note Lucid Resources::, also see
  742.      *Note Motif Resources::.)
  743.  
  744. `title' (class `Title')
  745.      Name to display in the title bar of the initial Emacs frame.
  746.  
  747.    Here are resources for controlling the appearance of particular faces
  748. (*note Faces::.):
  749.  
  750. `FACE.attributeFont'
  751.      Font for face FACE.
  752.  
  753. `FACE.attributeForeground'
  754.      Foreground color for face FACE.
  755.  
  756. `FACE.attributeBackground'
  757.      Background color for face FACE.
  758.  
  759. `FACE.attributeUnderline'
  760.      Underline flag for face FACE.  Use `on' or `true' for yes.
  761.  
  762. 
  763. File: emacs,  Node: Lucid Resources,  Next: Motif Resources,  Prev: Resources X,  Up: Command Arguments
  764.  
  765. Lucid Menu X Resources
  766. ======================
  767.  
  768.    If the Emacs installed at your site was built to use the X toolkit
  769. with the Lucid menu widgets, then the menu bar is a separate widget and
  770. has its own resources.  The resource names contain `pane.menubar'
  771. (following, as always, the name of the Emacs invocation or `Emacs'
  772. which stands for all Emacs invocations).  Specify them like this:
  773.  
  774.      Emacs.pane.menubar.RESOURCE:  VALUE
  775.  
  776. For example, to specify the font `8x16' for the menu bar items, write
  777. this:
  778.  
  779.      Emacs.pane.menubar.font:  8x16
  780.  
  781.    Resources for *non-menubar* toolkit popup menus have `menu*', in
  782. like fashion.  For example, to specify the font `8x16' for the popup
  783. menu items, write this:
  784.  
  785.      Emacs.menu*.font:    8x16
  786.  
  787.    For dialog boxes, use `dialog' instead of `menu':
  788.  
  789.      Emacs.dialog*.font:    8x16
  790.  
  791.    Experience shows that on some systems you may need to add `shell.'
  792. before the `pane.menubar' or `menu*'.  On some other systems, you must
  793. not add `shell.'.
  794.  
  795.    Here is a list of the specific resources for menu bars and popup
  796. menus:
  797.  
  798. `font'
  799.      Font for menu item text.
  800.  
  801. `foreground'
  802.      Color of the foreground.
  803.  
  804. `background'
  805.      Color of the background.
  806.  
  807. `buttonForeground'
  808.      In the menu bar, the color of the foreground for a selected item.
  809.  
  810. `horizontalSpacing'
  811.      Horizontal spacing in pixels between items.  Default is 3.
  812.  
  813. `verticalSpacing'
  814.      Vertical spacing in pixels between items.  Default is 1.
  815.  
  816. `arrowSpacing'
  817.      Horizontal spacing between the arrow (which indicates a submenu)
  818.      and the associated text.  Default is 10.
  819.  
  820. `shadowThickness'
  821.      Thickness of shadow line around the widget.
  822.  
  823. 
  824. File: emacs,  Node: Motif Resources,  Prev: Lucid Resources,  Up: Command Arguments
  825.  
  826. Motif Menu X Resources
  827. ======================
  828.  
  829.    If the Emacs installed at your site was built to use the X toolkit
  830. with the Motif widgets, then the menu bar is a separate widget and has
  831. its own resources.  The resource names contain `pane.menubar'
  832. (following, as always, the name of the Emacs invocation or `Emacs'
  833. which stands for all Emacs invocations).  Specify them like this:
  834.  
  835.      Emacs.pane.menubar.SUBWIDGET.RESOURCE:  VALUE
  836.  
  837.    Each individual string in the menu bar is a subwidget; the
  838. subwidget's name is the same as the menu item string.  For example, the
  839. word `Files' in the menu bar is part of a subwidget named
  840. `emacs.pane.menubar.Files'.  Most likely, you want to specify the same
  841. resources for the whole menu bar.  To do this, use `*' instead of a
  842. specific subwidget name.  For example, to specify the font `8x16' for
  843. the menu bar items, write this:
  844.  
  845.      Emacs.pane.menubar.*.fontList:  8x16
  846.  
  847. This also specifies the resource value for submenus.
  848.  
  849.    Each item in a submenu in the menu bar also has its own name for X
  850. resources; for example, the `Files' submenu has an item named `Save
  851. Buffer'.  A resource specification for a submenu item looks like this:
  852.  
  853.      Emacs.pane.menubar.popup_*.MENU.ITEM.RESOURCE: VALUE
  854.  
  855. For example, here's how to specify the font for the `Save Buffer' item:
  856.  
  857.      Emacs.pane.menubar.popup_*.Files.Save Buffer.fontList: 8x16
  858.  
  859.    For an item in a second-level submenu, such as `Check Message' under
  860. `Spell' under `Edit', the resource fits this template:
  861.  
  862.      Emacs.pane.menubar.popup_*.popup_*.MENU.RESOURCE: VALUE
  863.  
  864. For example,
  865.  
  866.      Emacs.pane.menubar.popup_*.popup_*.Spell.Check Message: VALUE
  867.  
  868.    It's impossible to specify a resource for all the menu bar items
  869. without also specifying it for the submenus as well.  So if you want the
  870. submenu items to look different from the menu bar itself, you must ask
  871. for that in two steps.  First, specify the resource for all of them;
  872. then, override the value for submenus alone.  Here is an example:
  873.  
  874.      Emacs.pane.menubar.*.fontList:  8x16
  875.      Emacs.pane.menubar.popup_*.fontList: 8x16
  876.  
  877.    For toolkit popup menus, use `menu*' instead of `pane.menubar'.  For
  878. example, to specify the font `8x16' for the popup menu items, write
  879. this:
  880.  
  881.      Emacs.menu*.fontList:  8x16
  882.  
  883.    Here is a list of the specific resources for menu bars and popup
  884. menus:
  885.  
  886. `armColor'
  887.      The color to show in an armed button.
  888.  
  889. `fontList'
  890.      The font to use.
  891.  
  892. `marginBottom'
  893. `marginHeight'
  894. `marginLeft'
  895. `marginRight'
  896. `marginTop'
  897. `marginWidth'
  898.      Amount of space to leave around the item, within the border.
  899.  
  900. `borderWidth'
  901.      The width of border around the menu item, on all sides.
  902.  
  903. `shadowThickness'
  904.      The width of the border shadow.
  905.  
  906. `bottomShadowColor'
  907.      The color for the border shadow, on the bottom and the right.
  908.  
  909. `topShadowColor'
  910.      The color for the border shadow, on the bottom and the right.
  911.  
  912. 
  913. File: emacs,  Node: Antinews,  Next: MS-DOS,  Prev: Command Arguments,  Up: Top
  914.  
  915. Emacs 19.28 and 19.29 Antinews
  916. ******************************
  917.  
  918.    For those users who live backwards in time, here is information about
  919. downgrading to Emacs version 19.28 or 19.29.  We hope you will enjoy the
  920. greater simplicity that results from the absence of certain Emacs 19.34
  921. features.
  922.  
  923.    * This version doesn't support Windows NT, or the DEC Alpha.
  924.  
  925.    * In Emacs 19.28, or even 19.29, the features for controlling
  926.      indentation in C are much simpler.  There is a separate variable
  927.      for each aspect of indentation which you can control.  Here is a
  928.      list of them:
  929.  
  930.     `c-indent-level'
  931.           Level of indentation of C statements with respect to
  932.           containing block.
  933.  
  934.     `c-label-offset'
  935.           Offset of C label lines and case statements relative to usual
  936.           indentation.
  937.  
  938.     `c-continued-brace-offset'
  939.           Extra indentation for substatements that start with
  940.           open-braces.  This is in addition to
  941.           `c-continued-statement-offset'.
  942.  
  943.     `c-continued-statement-offset'
  944.           Extra indentation for lines not starting new statements.
  945.  
  946.     `c-brace-offset'
  947.           Extra indentation for braces, compared with other text in
  948.           same context.
  949.  
  950.     `c-brace-imaginary-offset'
  951.           Imagined indentation of a C open brace that actually follows
  952.           a statement.
  953.  
  954.     `c-argdecl-indent'
  955.           Indentation level of declarations of C function arguments.
  956.  
  957.    * There is no support for editing formatted text.  The text formatter
  958.      TeX does a much better job of formatting than any formatted text
  959.      editor; we recommend you learn to use it.
  960.  
  961.    * `C-Mouse-2' now runs the menu for setting the default font.
  962.  
  963.    * F1 is no longer an alias for the Help key; you must actually type
  964.      `C-h' if you want help.
  965.  
  966.    * Integers and buffer sizes are limited to 24 bits on most machines.
  967.      But as memory gets more expensive, you won't want to edit such
  968.      large files any more.
  969.  
  970.    * There are no indirect buffers, so you can only display one view of
  971.      an outline.  Meanwhile, the prefix key for Outline minor mode is
  972.      now `C-c C-o'.
  973.  
  974.    * When you are in Transient Mark mode, incremental search always
  975.      deactivates the mark.
  976.  
  977.    * Dynamic abbrev completion has been eliminated in 19.28, and some
  978.      of the other dynamic abbrev customization features are also gone.
  979.  
  980.    * In Dired, Occur mode, Compilation mode, and other such modes, you
  981.      must use `C-c C-c' to select the item point is on.  RET won't do
  982.      it.
  983.  
  984.    * `M-x buffer-menu' now displays the menu buffer in another window.
  985.  
  986.    * The VC (version control) package no longer supports CVS or
  987.      selecting branches other than the principal branch.
  988.  
  989.    * There is no `recover-session' command; if Emacs crashes, you simply
  990.      have to remember which files you were editing before the crash,
  991.      and use `recover-file' on the individual files.
  992.  
  993.    * In Emacs Lisp mode, `C-M-x' now lets `defvar' operate as it
  994.      usually does--setting the value of the variable only if it has no
  995.      value yet.  Use `ESC ESC' to evaluate a Lisp expression, instead
  996.      of `M-:'.
  997.  
  998.    * GNU-standard long option names are not supported.  (Real hackers
  999.      prefer the shorter single-dash names, to save typing.)  All the
  1000.      initial options must come before all the action options, and
  1001.      whatever initial options you use must appear in this order: `-t',
  1002.      `-d', `-nw', `-batch', `-q' or `-no-init-file', `-no-site-file',
  1003.      `-u' or `-user', `-debug-init'.
  1004.  
  1005.    * Many special-case kludges for MS-DOS have been removed.  This means
  1006.      that many features don't work on MS-DOS; however, the code of Emacs
  1007.      is much simpler.
  1008.  
  1009.      For instance, you cannot print from within Emacs, Dired doesn't
  1010.      support shell wildcards in filenames, some Lisp packages won't
  1011.      work because their standard filenames are invalid on MS-DOS,
  1012.      `display-time' doesn't work, Font Lock mode won't work unless you
  1013.      create some faces by hand first, and `call-process' cannot
  1014.      redirect `stderr'.
  1015.  
  1016.      As an additional bonus, you get random characters inserted into the
  1017.      buffer without a warning (unless you're clever enough to discover
  1018.      that setting `visible-bell' makes this problem to go away).
  1019.  
  1020.      In a word, it's a great relief for those who still need proof that
  1021.      MS-DOG isn't a real operating system.
  1022.  
  1023. 
  1024. File: emacs,  Node: MS-DOS,  Next: Manifesto,  Prev: Antinews,  Up: Top
  1025.  
  1026. MS-DOS Issues
  1027. *************
  1028.  
  1029.    This section briefly describes the peculiarities of using Emacs under
  1030. the MS-DOS "operating system" (also known as "MS-DOG").  If you build
  1031. Emacs for MS-DOS, the binary will also run on Windows 3, Windows NT,
  1032. Windows 95, or OS-2 as a DOS application; the information in this
  1033. chapter applies for all of those systems, if you use an Emacs that was
  1034. built for MS-DOS.
  1035.  
  1036.    Note that it is possible to build Emacs specifically for Windows NT
  1037. or Windows 95.  If you do that, most of this chapter does not apply;
  1038. instead, you get behavior much closer to what is documented in the rest
  1039. of the manual, including support for long file names, multiple frames,
  1040. scroll bars, mouse menus, and subprocesses.  However, the section on
  1041. text files and binary files does still apply.  There are also two
  1042. sections at the end of this chapter which apply specifically for Windows
  1043. NT and 95.
  1044.  
  1045. * Menu:
  1046.  
  1047. * Keyboard and Mouse on MS-DOS::
  1048. * Display on MS-DOS::
  1049. * File Names on MS-DOS::
  1050. * Text and Binary::
  1051. * Printing and MS-DOS::
  1052. * Subprocesses on MS-DOS::
  1053. * Windows Subprocesses::
  1054. * System Menu on Windows::
  1055.  
  1056. 
  1057. File: emacs,  Node: Keyboard and Mouse on MS-DOS,  Next: Display on MS-DOS,  Up: MS-DOS
  1058.  
  1059. Keyboard and Mouse on MS-DOS
  1060. ============================
  1061.  
  1062.    The PC keyboard maps use the left Alt key as the META key.  You have
  1063. two choices for emulating the SUPER and HYPER keys: either the right
  1064. CONTROL key or the right ALT key by setting the variables
  1065. `dos-hyper-key' and `dos-super-key' to 1 or 2 respectively.
  1066.  
  1067.    The variable `dos-keypad-mode' is a flag variable which controls
  1068. what key codes are returned by keys in the numeric keypad.  There is no
  1069. dedicated LFD key; use `C-j' instead.  You can also define the kp-enter
  1070. key to act as LFD, by putting the following line into your `_emacs'
  1071. file:
  1072.  
  1073.      ;; Make the Enter key from the Numeric keypad act as LFD.
  1074.      (define-key function-key-map [kp-enter] [?\C-j])
  1075.  
  1076.    The key which is called DEL in Emacs (because that's how it is
  1077. designated on most workstations) is known as BS (backspace) on a PC.
  1078. That is why the PC-specific terminal initialization remaps the BS key
  1079. to act as DEL; the DEL key is remapped to act as `C-d' for the same
  1080. reasons.
  1081.  
  1082.    Emacs on MS-DOS supports a mouse (on the default terminal only).
  1083. The mouse commands work as documented, including those that use menus
  1084. and the menu bar (*note Menu Bars::.).  Scroll bars don't work in
  1085. MS-DOS Emacs.  PC mice usually have only two buttons; these act as
  1086. `Mouse-1' and `Mouse-2', but if you press both of them together, that
  1087. has the effect of `Mouse-3'.
  1088.  
  1089.    The variable `dos-display-scancodes', when non-`nil', directs Emacs
  1090. to display the ASCII value and the keyboard scan code of each
  1091. keystroke; this feature serves as a complement to the `view-lossage'
  1092. command, for debugging.
  1093.  
  1094. 
  1095. File: emacs,  Node: Display on MS-DOS,  Next: File Names on MS-DOS,  Prev: Keyboard and Mouse on MS-DOS,  Up: MS-DOS
  1096.  
  1097. Display on MS-DOS
  1098. =================
  1099.  
  1100.    Display on MS-DOS cannot use multiple fonts, but it does support
  1101. multiple faces, each of which can specify a foreground and a background
  1102. color.  Therefore, you can get the full functionality of Emacs packages
  1103. which use fonts (such as `font-lock', Enriched Text mode, and others)
  1104. by defining the relevant faces to use different colors.  Use the
  1105. `list-colors-display' and `list-faces-display' commands (*note
  1106. Modifying Faces::.) to see what colors and faces are available and what
  1107. they look like.
  1108.  
  1109.    Multiple frames (*note Frames::.) are supported on MS-DOS, but they
  1110. all overlap, so you only see a single frame at any given moment.  That
  1111. single visible frame occupies the entire screen.  When you run Emacs
  1112. under Windows version 3, you can make the visible frame smaller than
  1113. the full screen, but Emacs still cannot display more than a single
  1114. frame at a time.
  1115.  
  1116.    The `mode4350' command switches the display to 43 or 50 lines,
  1117. depending on your hardware; the `mode25' command switches to the
  1118. default 80x25 screen size.
  1119.  
  1120.    By default, Emacs only knows how to set screen sizes of 80 columns by
  1121. 25 or 43/50 rows.  However, if your video adapter has special video
  1122. modes that will switch the display to other sizes, you can have Emacs
  1123. support those too.  When you ask Emacs to switch the frame to N rows by
  1124. M cols dimensions, it checks if there is a variable called
  1125. `screen-dimensions-NxM', and if so, uses its value (which must be an
  1126. integer) as the video mode to switch to.  (Emacs switches to that video
  1127. mode by calling the BIOS `Set Video Mode' function with the value of
  1128. `screen-dimensions-NxM' in the `AL' register.)  For example, suppose
  1129. your adapter will switch to 66x80 dimensions when put into video mode
  1130. 85.  Then you can make Emacs support this screen size by putting the
  1131. following into your `_emacs' file:
  1132.  
  1133.      (setq screen-dimensions-66x80 85)
  1134.  
  1135.    Since Emacs on MS-DOS can only set the frame size to specific
  1136. supported dimensions, it cannot honor every possible frame resizing
  1137. request.  When an unsupported size is requested, Emacs chooses the next
  1138. larger supported size beyond the specified size.  For example, if you
  1139. ask for 36x80 frame, you will get 50x80 instead.
  1140.  
  1141.    The variables `screen-dimensions-NxM' are used only when they
  1142. exactly match the specified size; the search for the next larger
  1143. supported size ignores them.  In the above example, even if your VGA
  1144. supports 44x80 dimensions and you define a variable
  1145. `screen-dimensions-44x80' with a suitable value, you will still get
  1146. 50x80 screen when you ask for a 36x80 frame.  If you want to get the
  1147. 44x80 size in this case, you can do it by setting the variable named
  1148. `screen-dimensions-36x80' with the same video mode value as
  1149. `screen-dimensions-44x80'.
  1150.  
  1151.    Changing frame dimensions on MS-DOS has the effect of changing all
  1152. the other frames to the new dimensions.
  1153.  
  1154. 
  1155. File: emacs,  Node: File Names on MS-DOS,  Next: Text and Binary,  Prev: Display on MS-DOS,  Up: MS-DOS
  1156.  
  1157. File Names on MS-DOS
  1158. ====================
  1159.  
  1160.    MS-DOS normally uses a backslash, `\', to separate name units within
  1161. a file name, instead of the slash used on other systems.  Emacs on
  1162. MS-DOS permits use of either slash or backslash, and also knows about
  1163. drive letters in file names.
  1164.  
  1165.    On MS-DOS, file names are case-insensitive and limited to eight
  1166. characters, plus optionally a period and three more characters.  Emacs
  1167. knows enough about these limitations to handle file names that were
  1168. meant for other operating systems.  For instance, leading dots `.' in
  1169. file names are invalid in MS-DOS, so Emacs transparently converts them
  1170. to underscores `_'; thus your default init file (*note Init File::.) is
  1171. called `_emacs' on MS-DOS.  Excess characters before or after the
  1172. period are generally ignored by MS-DOS itself, so if you, e.g., visit a
  1173. file `LongFileName.EvenLongerExtension', you will silently get
  1174. `longfile.eve'; but Emacs will still display the long file name on the
  1175. mode line.  Other than that, it's up to you to specify file names which
  1176. are valid under MS-DOS; the transparent conversion as described above
  1177. only works on file names built into Emacs.
  1178.  
  1179.    The above restrictions on the file names on MS-DOS make it almost
  1180. impossible to construct the name of a backup file (*note Backup
  1181. Names::.) without losing some of the original file name characters.  For
  1182. example, the name of a backup file for `docs.txt' is `docs.tx~' even if
  1183. single backup is used.
  1184.  
  1185.    If you run Emacs as a DOS application under Windows 95 or NT, you can
  1186. turn on support for long file names.  If you do that, Emacs doesn't
  1187. truncate file names or convert them to lower case; instead, it uses the
  1188. file names that you specify, verbatim.  To enable long file name
  1189. support, set the environment variable `LFN' to `y' before starting
  1190. Emacs.
  1191.  
  1192.    MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
  1193. that the directory where it is installed is the value of `HOME'
  1194. environment variable.  That is, if your Emacs binary, `emacs.exe', is
  1195. in the directory `c:/utils/emacs/bin', then Emacs acts as if `HOME'
  1196. were set to `c:/utils/emacs'.  In particular, that is where Emacs looks
  1197. for the init file `_emacs'.  With this in mind, you can use `~' in file
  1198. names as an alias for the home directory, as you would in Unix.  You
  1199. can also set `HOME' variable in the environment before starting Emacs;
  1200. its value will then override the above default behavior.
  1201.  
  1202. 
  1203. File: emacs,  Node: Text and Binary,  Next: Printing and MS-DOS,  Prev: File Names on MS-DOS,  Up: MS-DOS
  1204.  
  1205. Text Files and Binary Files
  1206. ===========================
  1207.  
  1208.    Emacs on MS-DOS distinguishes between text and binary files.  This
  1209. distinction is not part of MS-DOS; it is made by Emacs only.  Emacs
  1210. treats files of human-readable text (including program source code) as
  1211. text files, and treats executable programs, compressed archives, etc.,
  1212. as binary files.  Emacs uses the file name to decide whether to treat a
  1213. file as text or binary: the variable `file-name-buffer-file-type-alist'
  1214. defines the file name patterns which denote binary files.
  1215.  
  1216.    Emacs reads and writes binary files verbatim.  Text files use a two
  1217. character sequence to end a line: carriage-return (control-m) followed
  1218. by newline (control-j).  When you visit a text file, Emacs strips off
  1219. these control-m characters; when you write a text file to disk, Emacs
  1220. puts them back in.  Thus, the text appears within Emacs with just a
  1221. newline character at the end of each line.
  1222.  
  1223.    You can tell whether Emacs considers the visited file as text or
  1224. binary based on the mode line (*note Mode Line::.).  Text files have a
  1225. `T:' marker prefixed to the major mode name; binary files have a `B:'
  1226. prefix.
  1227.  
  1228.    One consequence of this special format-conversion of text files is
  1229. that character positions as reported by Emacs (*note Position Info::.)
  1230. do not agree with the file size information known to the operating
  1231. system.
  1232.  
  1233. 
  1234. File: emacs,  Node: Printing and MS-DOS,  Next: Subprocesses on MS-DOS,  Prev: Text and Binary,  Up: MS-DOS
  1235.  
  1236. Printing and MS-DOS
  1237. ===================
  1238.  
  1239.    Printing commands, such as `lpr-buffer' (*note Hardcopy::.) and
  1240. `ps-print-buffer' (*note Postscript::.) can work in MS-DOS by sending
  1241. the output to one of the printer ports, if a Unix-style `lpr' program
  1242. is unavailable.  A few DOS-specific variables control how this works.
  1243.  
  1244.    If you want to use your local printer, printing on it in the usual
  1245. DOS manner, then set the Lisp variable `dos-printer' to the name of the
  1246. printer port--for example. `"PRN"', the usual local printer port
  1247. (that's the default), or `"LPT2"' or `"COM1"' for a serial printer.
  1248. You can also set `dos-printer' to a file name, in which case "printed"
  1249. output is actually appended to that file.  If you set `dos-printer' to
  1250. `"NUL"', printed output is silently discarded.
  1251.  
  1252.    If you set `dos-printer' to a file name, it's best to use an
  1253. absolute file name.  Emacs changes the working directory according to
  1254. the default directory of the current buffer, so if the file name in
  1255. `dos-printer' is relative, you will end up with several such files,
  1256. each one in the directory of the buffer from which the printing was
  1257. done.
  1258.  
  1259.    The commands `print-buffer' and `print-region' call the `pr'
  1260. program, or use special switches to the `lpr' program, to produce
  1261. headers on each printed page.  MS-DOS doesn't normally have these
  1262. programs, so by default, the variable `lpr-headers-switches' is set so
  1263. that the requests to print page headers are silently ignored.  Thus,
  1264. `print-buffer' and `print-region' produce the same output as
  1265. `lpr-buffer' and `lpr-region', respectively.  If you do have a suitable
  1266. `pr' program (e.g., from GNU Textutils), set `lpr-headers-switches' to
  1267. `nil'; Emacs will then call `pr' to produce the page headers, and print
  1268. the resulting output as specified by `dos-printer'.
  1269.  
  1270.    Finally, if you do have an `lpr' work-alike, you can set
  1271. `print-region-function' to `nil'.  Then Emacs uses `lpr' for printing,
  1272. as on other systems.  (If the name of the program isn't `lpr', set the
  1273. `lpr-command' variable to specify where to find it.)
  1274.  
  1275.    A separate variable, `dos-ps-printer', defines how PostScript files
  1276. should be printed.  If its value is a string, it is used as the name of
  1277. the device (or file) to which PostScript output is sent, just as
  1278. `dos-printer' is used for non-PostScript printing.  (These are two
  1279. distinct variables in case you have two printers attached to two
  1280. different ports, and only one of them is a PostScript printer.)  If the
  1281. value of `dos-ps-printer' is not a string, then the variables
  1282. `ps-lpr-command' and `ps-lpr-switches' (*note Postscript::.) control
  1283. how to print PostScript files.  Thus, if you have a non-PostScript
  1284. printer, you can set these variables to the name and the switches
  1285. appropriate for a PostScript interpreter program (e.g., Ghostscript).
  1286.  
  1287.    For example, to use Ghostscript for printing on an Epson printer
  1288. connected to `LPT2' port, put this on your `.emacs' file:
  1289.  
  1290.      (setq dos-ps-printer t)  ; Anything but a string.
  1291.      (setq ps-lpr-command "c:/gs/gs386")
  1292.      (setq ps-lpr-switches '("-q" "-dNOPAUSE"
  1293.                  "-sDEVICE=epson"
  1294.                  "-r240x72"
  1295.                  "-sOutputFile=LPT2"
  1296.                  "-Ic:/gs"
  1297.                  "-"))
  1298.  
  1299. (This assumes that Ghostscript is installed in the `"c:/gs"' directory.)
  1300.  
  1301.